<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>比较computed与methods</title>
<!--引入Vue库-->
<script src="vue.js"></script>
</head>
<body>    
  <div id="app">
      <p>computed计算属性: "{{ time1 }}"</p>
	  <p>methods方法: "{{ time2() }}"</p>
  </div>
  <script>
    var vm = new Vue({
    el: '#app',
    computed:{
      time1: function () {
          return (new Date()).toLocaleTimeString()
      }
    },
    methods: {
      time2: function () {
        return (new Date()).toLocaleTimeString()
      }
    }    
  })
  </script>
</body>
</html>